From: Carlos Garnacho Date: Wed, 9 Mar 2022 22:11:03 +0000 (+0100) Subject: grabHelper: Special case event funneling towards the OSK X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~507^2^2~7 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=c29e0cf6e60a1296b43fc33d94f2acc649046cf9;p=gnome-shell.git grabHelper: Special case event funneling towards the OSK In the case of bringing up the OSK while there is a grab (like, every GNOME Shell entry), we used to special case event capturing so events directed to the OSK would be let through. When Clutter.Grab came around, events would be propagated only within the actor hierarchy that holds the grab, which rendered this special case just as useless as the OSK while a grab was hold. Since it wouldn't be part of the grab hierarchy, clicking on the OSK would do nothing. In order to let the OSK handle events, double down on the special case and let it forward the event directly to the actor under the device, instead of trying to let it through somehow. Since the actor under the device are usually OSK buttons in this case, we don't need further propagation to make it work, which makes the OSK functional again while the shell holds a grab. Part-of: --- diff --git a/js/ui/grabHelper.js b/js/ui/grabHelper.js index af4641014..c4028fc38 100644 --- a/js/ui/grabHelper.js +++ b/js/ui/grabHelper.js @@ -272,7 +272,7 @@ var GrabHelper = class GrabHelper { this.currentGrab.actor.contains(targetActor)) return Clutter.EVENT_PROPAGATE; - if (Main.keyboard.shouldTakeEvent(event)) + if (Main.keyboard.maybeHandleEvent(event)) return Clutter.EVENT_PROPAGATE; if (button || touchBegin) { diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js index 6512bf0d2..af195dccf 100644 --- a/js/ui/keyboard.js +++ b/js/ui/keyboard.js @@ -1263,13 +1263,19 @@ var KeyboardManager = class KeyBoardManager { this._keyboard.resetSuggestions(); } - shouldTakeEvent(event) { + maybeHandleEvent(event) { if (!this._keyboard) return false; const actor = global.stage.get_event_actor(event); - return Main.layoutManager.keyboardBox.contains(actor) || - !!actor._extendedKeys || !!actor.extendedKey; + + if (Main.layoutManager.keyboardBox.contains(actor) || + !!actor._extendedKeys || !!actor.extendedKey) { + actor.event(event); + return true; + } + + return false; } };